import Vue from 'vue'
import VueRouter from 'vue-router'


const MainPart =()=>import("../pages/MainPart/MainPart");
import Order from "../pages/Order/Order";
import PersonInfo from "../pages/PersonInfo/PersonInfo";
import Search from "../pages/Search/Search";
const login =()=>import("../pages/login/login")

const Shop = ()=>import("../pages/Shops/Shop")
const ShopGoods = ()=>import("../pages/Shops/ShopGoods/ShopGoods")
const ShopInfo = ()=>import("../pages/Shops/ShopInfo/ShopInfo")
const ShopRatings = ()=>import("../pages/Shops/ShopRatings/ShopRatings")
Vue.use(VueRouter)

export default new VueRouter({
//所有路由
    routes:[
        {
            path:'/',
            redirect:'/mainpart'
        },
        {
            path:'/mainpart',
            component:MainPart,
            meta:{
                showFooter:true
            }
        },
        {
            path:'/order',
            component:Order,
            meta:{
                showFooter:true
            }
        },        {
            path:'/personinfo',
            component:PersonInfo,
            meta:{
                showFooter:true
            }
        },
        {
            path:'/search',
            component:Search,
            meta:{
                showFooter:true
            }
        },
        {
            path:'/login',
            component:login
        },
        {
            path:'/shop',
            component:Shop,
            children:[
                 {
                  path:'/shop/goods',
                  component:ShopGoods
                 },
                {
                    path:'/shop/info',
                    component:ShopInfo
                },
                {
                    path:'/shop/ratings',
                    component:ShopRatings
                },
                {
                    path:'',
                    redirect:'/shop/goods'
                }
            ]
        }
    ]
})